package com.pizza.model;

import java.io.Serializable;

/**
 * Class Diametre, entite du modele.
 *
 */
public class Diametre implements Serializable {

	private int id;

	private String description;

	private int nbPersonnes;

	public Diametre(int id, String description, int nbPersonnes) {
		super();
		this.id = id;
		this.description = description;
		this.nbPersonnes = nbPersonnes;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getNbPersonnes() {
		return nbPersonnes;
	}

	public void setNbPersonnes(int nbPersonnes) {
		this.nbPersonnes = nbPersonnes;
	}

	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if ((obj == null) || (obj.getClass() != this.getClass()))
			return false;
		Diametre d = (Diametre) obj;
		return (id == d.id && description.equals(d.description) && nbPersonnes == d.nbPersonnes);
	}

	/* A redéfinir pour l'utilisation de equals sur une instance Diametre dans HashTable/HashMap */
	public int hashCode() {
		return id;
	}

}
